﻿Public Class ReportUT509_O
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            BL.Report.SetMonthList(Me.ddlMonth)
            BL.Report.SetYearList(Me.ddlYear)
            LoadStatus()
        End If
    End Sub

    Private Sub LoadStatus()
        Me.ddlStatus.DataSource = BL.OfficerStatus.AllStatus
        Me.ddlStatus.DataTextField = "STATUS_DESC"
        Me.ddlStatus.DataValueField = "STATUS_ID"
        Me.ddlStatus.DataBind()
    End Sub

    Protected Sub btnPDF_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPDF.Click
        Me.ClientScript.RegisterClientScriptBlock(Me.GetType, "ut509", "window.open('report/exportpdf.aspx?rptname=ut509', 'exportpdf','')", True)
        Me.Session("reportdatasource") = BL.Report.ReportUT509(Me.ddlMonth.SelectedValue, Me.ddlYear.SelectedValue, Me.ddlStatus.SelectedValue, Me.incomeFrom.Text, Me.incomeTo.Text)
        Dim lstParam As New List(Of String)
        lstParam.Add(Me.ddlStatus.SelectedItem.Text)
        Me.Session("reportparameter") = lstParam
    End Sub
End Class